home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / misc / emu / ATUtilities.lha / ATUtilities / hl.c < prev    next >
C/C++ Source or Header  |  2000-09-26  |  3KB  |  94 lines

  1. /* ******************************************************************* */
  2. /* **                                                               ** */
  3. /* **                    ATKeyboard Utility Help                    ** */
  4. /* **            Copright (C) 1992-1993 by Thomas Dreibholz         ** */
  5. /* **                      All rights reserved                      ** */
  6. /* **                                                               ** */
  7. /* ******************************************************************* */
  8.  
  9. #include <exec/types.h>
  10. #include <intuition/intuition.h>
  11.  
  12. struct ATUtilitiesBase *ATUtilitiesBase;
  13. struct GfxBase *GfxBase;
  14.  
  15. VOID main(argc,argv)
  16.  LONG argc;
  17.  UBYTE *argv[];
  18. {
  19.  REGISTER BOOL                 ende;
  20.  REGISTER UBYTE               *name;
  21.  REGISTER ULONG                Class;
  22.  register struct Gadget       *gad;
  23.  register struct Window       *win;
  24.  register struct RastPort     *rp;
  25.  register struct TextFont     *opal;
  26.  register struct IntuiMessage *msg;
  27.  
  28.  GfxBase=OpenLibrary("graphics.library",0);
  29.  if(GfxBase==NULL) exit(0);
  30.  ATUtilitiesBase=OpenLibrary("at-utilities.library",0L);
  31.  if(ATUtilitiesBase!=NULL)
  32.   {
  33.    win=CreateStdWindow("Hilfedatei laden",75,75,450,75,CLOSEWINDOW|GADGETUP,
  34.                        ACTIVATE|WINDOWCLOSE|WINDOWDEPTH|WINDOWDRAG);
  35.    if(win!=NULL)
  36.      {
  37.       rp=win->RPort;
  38.       opal=GetOpalFont();
  39.       if(opal) SetFont(rp,opal);
  40.       SelectStdFPen(rp);
  41.       WriteText(rp,15,20,"Bitte geben Sie hier den Namen der Hilfedatei");
  42.       WriteText(rp,15,30,"an. Klicken Sie danach auf \"Lade Hilfedatei\".");
  43.       if(argc>1) name=argv[0]; else name="SYS:PC/ATUtilities/Help/ATKeyboard.help";
  44.       name=CreateStringGadget(win,15,40,410,10,name,256,0);
  45.       CreateBoolGadget(win,15,55,200,12,"Lade Hilfedatei",1);
  46.       CreateBoolGadget(win,225,55,200,12,"Information",2);
  47.       ende=FALSE;
  48.       while(ende==FALSE)
  49.        {
  50.         WaitPort(win->UserPort);
  51.         msg=GetMsg(win->UserPort);
  52.         Class=msg->Class;
  53.         gad=msg->IAddress;
  54.         ReplyMsg(msg);
  55.         switch(Class)
  56.          {
  57.           case GADGETUP:
  58.             switch(gad->GadgetID)
  59.              {
  60.               case 1:
  61.                 Help(name,0);
  62.                break;
  63.               case 2:
  64.                 InformationBox("Hilfedateien-Lader - Information",
  65.                                "Hilfe-Lader - Version 1.0",
  66.                                "Copyright (C) 1993 by",
  67.                                "Thomas Dreibholz",
  68.                                "All rights reserved.",
  69.                                "SYS:PC/ATUtilities/Icons/Help");
  70.                break;
  71.              }
  72.            break;
  73.           case CLOSEWINDOW:
  74.             ende=TRUE;
  75.            break;
  76.          }
  77.        }
  78.       DeleteStdWindow(win);
  79.       if(opal) CloseFont(opal);
  80.      }
  81.     else
  82.      {
  83.       InfoRequest("Kann Fenster nicht öffnen!");
  84.      }
  85.    CloseLibrary(ATUtilitiesBase);
  86.   }
  87.  else
  88.   {
  89.    printf("FEHLER: Keine ATUtilities-Library!\n");
  90.   }
  91.  exit(0);
  92. }
  93.  
  94.